FTPM_OPTEE_EXT_VERSION = 1.0
FTPM_OPTEE_EXT_SOURCE = local
FTPM_OPTEE_EXT_SITE = $(BR2_PACKAGE_FTPM_OPTEE_EXT_SITE)
FTPM_OPTEE_EXT_SRC = $(BR2_PACKAGE_FTPM_OPTEE_PACKAGE_SITE)
FTPM_OPTEE_EXT_SITE_METHOD = local
FTPM_OPTEE_EXT_TA_SRC = $(BR2_PACKAGE_FTPM_OPTEE_EXT_TA_SRC)

define FTPM_OPTEE_EXT_INSTALL_TA
	echo "Installing fTPM based on OPTEE" && \
		mkdir -p $(TARGET_DIR)/lib/optee_armtz && \
		$(INSTALL) -v -p --mode=444 \
		--target-directory=$(TARGET_DIR)/lib/optee_armtz \
		$(FTPM_OPTEE_EXT_SRC)/$(FTPM_OPTEE_EXT_TA_SRC)/out/fTPM/bc50d971-d4c9-42c4-82cb-343fb7f37896.ta
endef

FTPM_OPTEE_EXT_POST_INSTALL_TARGET_HOOKS += FTPM_OPTEE_EXT_INSTALL_TA

$(eval $(cmake-package))
